/*******************************************************************************
 * Copyright (c) 2011 UCLA Medical Imaging Informatics Group
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 ******************************************************************************/
package imageviewer.ui.swing.flamingo;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.AbstractButton;

public class ClonedButtonSyncListener implements ItemListener {

	AbstractButton target=null;

	public ClonedButtonSyncListener(AbstractButton target) {this.target=target;}

	public void itemStateChanged(ItemEvent ie) {

		int stateChange=ie.getStateChange();
		switch (stateChange) {
		  case ItemEvent.DESELECTED: target.setSelected(false); break;
		  case ItemEvent.SELECTED: target.setSelected(true); break;
		}
	}
}
